package com.aaa.web.controller.employeecontroller;

import com.aaa.entity.School;
import com.aaa.web.commons.EmpQuery;
import com.aaa.web.commons.Result;
import com.aaa.web.service.iemployeeservice.ISchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;
/**
* @program:
* @description:
* @author:
* @create:
**/
@Controller
@RequestMapping("/school")
public class SchoolController {

    @Autowired
    private ISchoolService storeService;
    /**
     * 门店管理页面
     * @return
     */
    @RequestMapping("/getSchoolPage")
    public String getStorePage(){
        return "views/webhtml/employee/school";
    }

    /**
     * 显示所有门店信息
     * @param query
     * @return
     */
    @RequestMapping("/getSchool")
    @ResponseBody
    public Map getStore(EmpQuery query){
        return storeService.getStore(query);
    }

    /**
     * @param school
     * @return
     */
    @RequestMapping("/addSchool")
    @ResponseBody
    public Result addSchool(School school){
        return storeService.addSchool(school);
    }
    @RequestMapping("/editSchool")
    @ResponseBody
    public Result editSchool(School school){
        return storeService.editSchool(school);
    }

}
